if (!jsx3.lang.Class.forName("ux.cdb.admin.approvePkg.RcpPkgList")) {

/**
 * Define the <code>name of class</code> class.
 * This class inherit from <code>jsx3.gui.Block<code> GUI class.
 */
jsx3.Class.defineClass(
		"ux.cdb.admin.approvePkg.RcpPkgList",
		jsx3.gui.Block,
		null,
		function (objRoot) {

			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.onAfterDeserialize = function() {
				this.mtxRcpPkgList = this.get("mtxRcpPkg");
				this.curPage = ux.megatron.Main.getServer().getDynamicProperty("@cdb@apvPkg@curPage");
				this.pageSize = ux.megatron.Main.getServer().getDynamicProperty("@cdb@apvPkg@pageNum");
				this.pagebar = this.loadUIojb.get("blkPageWheel");
				this.pagebar.initialize(); 
				this.pagebar.bindWithMatrix(this, this.loadPagination, this.mtxRcpPkgList);
			}
			
			objRoot.prototype.loadPagination = function(msg) {
                this.curPage = (msg && msg.currentPageNumber) ? msg.currentPageNumber : (this.curPage || 1);
                this.callMatrixDate();
            };

			
			/**
			* initialize Province receipt package UI
			*/
			objRoot.prototype.initUI = function(parentId){
				if(parentId){
					this.parentId = parentId;
					this.callMatrixDate();
				}
			}

			objRoot.prototype.callMatrixDate = function(){
				var me = this;
				ux.megatron.util.Dwr.callDwr("RetailStudentLoanBatchAuditingUCC",
					"getBatchApprovalInfoListByConcentrateApprovalInfoId",[this.parentId,this.curPage,this.pageSize],
					me,me.callBackProvRcpPkgData,
					"RetailStudentLoanBatchAuditingUCC");
			}

			objRoot.prototype.callBackProvRcpPkgData = function(dwrObjectList){
				if(!dwrObjectList){
					jsx3.log("DWR loadProvRcpPkgData failed");
					return;
				}
				this.totalRecordCount = dwrObjectList.content.page.count;
				this.totalPages = (this.totalRecordCount % this.pageSize > 0) ? (parseInt(this.totalRecordCount / this.pageSize) + 1) : (this.totalRecordCount / this.pageSize);
				if (this.totalPages == 0) this.totalPages = 1;
				this.pagebar.setValue(this.curPage,this.totalPages,this.pageSize,this.totalRecordCount); 

				var cdfDoc = ux.megatron.util.Dwr.toCdfDocument(dwrObjectList.content.data,"jsxroot",{"batchApprovalInfoId":"jsxid"});
				this.mtxRcpPkgList.setSourceXML(cdfDoc);
				this.mtxRcpPkgList.repaintData();
			}

			objRoot.prototype.onLoadContractDetailDlg = function(){
				var parent = ux.megatron.Main.getServer().getBodyBlock();
				var me = this;
				ux.megatron.Main.loadUIResourceAsync(parent,
						"ux.cdb.admin", 
						"ux/cdb/admin/approvePkg/ui/contractDetailDlg.xml",
						me,me.onLoadcontractDetialDlgSuccess);
			}

			objRoot.prototype.onLoadcontractDetialDlgSuccess = function(objEvent){
				this.detailDlg = objEvent.obj;
				objEvent.obj.opener = this;
				var selectedid = this.mtxRcpPkgList.getSelectedNodes().get(0).getAttribute("jsxid");
				this.detailDlg.get("blkWorld").onInitializeUI(selectedid);
			}

		});
}

